package com.hmall.controller.back;

import com.hmall.model.ComSendMsg;

import com.hdmall.business.common.util.HttpClientUtil;

import java.util.HashMap;
import java.util.Map;
import java.util.TimerTask;


public class RemindTask extends TimerTask {
    private ComSendMsg comSendMsg;

    RemindTask(ComSendMsg comSendMsg) {
        this.comSendMsg = comSendMsg;
    }

    @Override
    public void run() {
        System.out.println(comSendMsg.toString());

        Map<String, String> map = new HashMap<>();
        map.put("userName", comSendMsg.getUsername());
        map.put("sendType", comSendMsg.getSendType());
        map.put("body", comSendMsg.getBody());
        map.put("title", comSendMsg.getTitle());
        map.put("value", comSendMsg.getValue());
        HttpClientUtil.doGetWithParam("http://47.98.169.251:9092/msg/directPcMsgPush",
                map);
        System.gc();
    }
}
